function showTypeCommodity(id,type) {
    $.ajax({
        url:'/user/typeListCommodity/'+id,
        type:'get',
        dataType:'json',
        success:function (res) {
            let str=``
            for (let i=0;i<res.length;i++){
                str+=`
                    <div class="item">
                       <img style="width: 40px;height:30px" src="${res[i].img}"/>
                       <p><a href="/user/details/${res[i].id}">${res[i].name}</a></p>
                       <p><font color="red" >${res[i].price}</font></p>
                    </div>
                `
            }
            $('#box').html(`
            <div class="hot">
               <h3 style="display: inline;">${type}</h3>
<!--               <img src="img/title2.jpg"/>-->
            </div>
            <!--左边大图+右边商品-->
            <!--左边大图-->
            <div class="left">
               <img src="${res[0].img}" width="95%"/>
            </div>
            <!--右边商品-->
            <div class="right">
               <div class="middle">
                  <img  src="${res[0].img}" width="95%" height="240px"/>
               </div>
               ${str}
            </div>
            `)
        }
    })
}
function showRecommendCommodity() {
    $.ajax({
        url:'/admin/recommendList',
        type:'get',
        dataType:'json',
        success:function (res) {
            let str=``
            for (let i=0;i<res.length;i++){
                str+=`
                    <div class="item">
                       <img style="width: 40px;height:30px" src="${res[i].img}"/>
                       <p><a href="/user/details/${res[i].id}">${res[i].name}</a></p>
                       <p><font color="red" >${res[i].price}</font></p>
                    </div>
                `
            }
            $('#box').html(`
            <div class="hot">
               <h3 style="display: inline;">明星同款</h3>
<!--               <img src="img/title2.jpg"/>-->
            </div>
            <!--左边大图+右边商品-->
            <!--左边大图-->
            <div class="left">
               <img src="${res[0].img}" width="95%"/>
            </div>
            <!--右边商品-->
            <div class="right">
               <div class="middle">
                  <img  src="${res[0].img}" width="95%" height="240px"/>
               </div>
               ${str}
            </div>
            `)
        }
    })
}